#include <bits/stdc++.h>
using namespace std;
int n;
const int N=2*1e5+50;
int a[N],b[N],c[N];
bool vis[N*1000];
int main(void){
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        scanf("%d",&a[i]);
    }
    int top=0;
    for(int i=0;i<n;i++){
        scanf("%d",&b[i]);
        if(vis[b[i]]){
            c[i]=0;
        }
        else{
            c[i]=1;
            //printf("top %d\n",top);
            for(int j=top;j<n;j++){
                if(a[j]==b[i]){
                    top++;
                    break;
                }
                else{
                    vis[a[j]]=true;
                    c[i]++;
                    top++;
                }
            }
        }
    }
    printf("%d",c[0]);
    for(int i=1;i<n;i++){
        printf(" %d",c[i]);
    }
    printf("\n");
    return 0;
}